﻿<!DOCTYPE HTML>
<html>
<head>
<#include "/script.ftl">
<link rel="stylesheet" type="text/css" href="../static/eth/css/orderDetail.css" />
<script type="text/javascript" src="../static/eth/js/orderDetail.js"></script>
<title>订单列表</title>
</head>
<body id="body" class="detail_body">
	<div class="page-container">
		<div class="cl detail_condition">
	    <ul class="detail_item">
	        <li><label>订单状态</label></li>
	        <li><label>订单编号</label></span></li>
	        <li><label>PNR</label></li>
	        <li><label>创建时间</label></li>
	        <li><label>订单来源</label></li>
	        <li><label>外部订单号</label></li>
	        <li><label>出票方式</label></li>
	    </ul>
	    <ul class="detail_item2">
	        <li class="c-red"><span>&nbsp${order.orderStatusName!""}</span></li>
	        <li>&nbsp&nbsp<strong>${order.orderNum!''}</strong></li>
	        <li>&nbsp&nbsp<strong>${order.pnr!''}</strong></li>
	        <li>&nbsp&nbsp<span>${order.creationDateStr!''}</span></li>
	        <li><span>&nbsp${order.platformName!''}</span></li>
	        <li><span>&nbsp&nbsp${order.platformOrderNum!''}</span></li>
	        <li><span>&nbsp${order.ticketingTypeName!''}</span></li>
	    </ul>
	    <div class="detail_item3">
		    <ul>
		    	<#if order.orderStatus! ='4' || order.orderStatus! ='6' || order.orderStatus! ='7' || order.orderStatus! ='8'>
					<li>
						<lable>
							<a onClick="order_tuipiao('<center><strong>申请退票原因</strong><center>','aftersale?flag=tuipiao&orderId=${order.orderId!}','','800','270')" href="javascript:;" class="btn btn-primary radius" style="width:100px">申请退票</a>
						</lable>
					</li>
					<li class="mt-5">
						<lable>	
							<a onClick="order_gaiqi('申请改期','aftersale?flag=gaiqi&orderId=${order.orderId!}','800','600')" href="javascript:;" class="btn btn-primary radius" style="width:100px">申请改期</a>
						</lable>
					</li>
					<li class="mt-5">
						<lable>
							<a onClick="order_tuipiao('<center><strong>申请废票原因</strong><center>','aftersale?flag=feipiao&orderId=${order.orderId!}','','800','270')" href="javascript:;" class="btn btn-primary radius" style="width:100px">申请废票</a>
						</lable>
					</li>
					<li class="mt-5">
						<lable>
							<a  href="javascript:;" class="btn btn-primary radius" style="width:100px">发送行程单</a>
						</lable>
					</li>
				</#if>
			</ul>
		</div>
	     <#list passengerMap.passengerTypes?keys as passengerType>
	     	<#if passengerType_index=0>
	    	<ul class="detail_item4">	    		
	        	<li><span>¥<strong class="f-24">${order.totalAmount!""}</strong></span><sub class="c-primary pl-10 f-14"><a onClick="trade_detail('交易明细','tradeDetail?orderId=${order.orderId!}&orderStatus=${order.orderStatus!}','800','300')" href="javascript:;">明细</a></sub></li>	        	
	     		<#if passengerType! ="ADT" || passengerType! ="OTHER">
	     		<li><strong>成人</strong></li>
	     		<li class="commision_reward"><label>代理费</label><span>#{(order.commisionPolicy.commision)!0;m2M2}%</span></li>
	        	<li class="commision_reward"><label>奖励扣</label><span>#{(order.commisionPolicy.reward)!0;m2M2}%</span></li>
	        	<li><label>开票手续费</label><span> #{(order.commisionPolicy.ticketingPrice)!0;m2M2}</span></li>
	     		<#elseif  passengerType! ="CHD">
	     		 <li><strong>儿童</strong></li>
			     <li class="commision_reward"><label>代理费</label><span class="">#{(order.commisionPolicy.chdCommision)!0;m2M2}%</span></li>
			     <li class="commision_reward"><label>奖励扣</label><span>#{(order.commisionPolicy.chdReward)!0;m2M2}%</span></li>
			     <li><label>开票手续费</label><span> #{(order.commisionPolicy.chdTicketingPrice)!0;m2M2}</span></li>
	     		<#elseif  passengerType! ="INF">
	     		<li><strong>婴儿</strong></li>
			    <li class="commision_reward"><label>代理费</label><span>#{(order.commisionPolicy.infCommision)!0;m2M2}%</span></li>
			   	<li class="commision_reward"><label>奖励扣</label><span>#{(order.commisionPolicy.infReward)!0;m2M2}%</span></li>
			    <li><label>开票手续费</label><span> #{(order.commisionPolicy.infTicketingPrice)!0;m2M2}</span></li>
	     		</#if>
	     	</ul>	     	
	     	<#else>
		     	<#if passengerType! ="ADT">
		     	<ul class="detail_item5">		     	
			        <li><strong>成人</strong></li>
			        <li class="commision_reward"><label>代理费</label><span>#{(order.commisionPolicy.commision)!0;m2M2}%</span></li>
			        <li class="commision_reward"><label>奖励扣</label><span>#{(order.commisionPolicy.reward)!0;m2M2}%</span></li>
			        <li><label>开票手续费</label><span> #{(order.commisionPolicy.ticketingPrice)!0;m2M2}</span></li>
	    		</ul>
		     	<#elseif passengerType! ="CHD">
		     	<ul class="detail_item5">
			        <li><strong>儿童</strong></li>
			        <li class="commision_reward"><label>代理费</label><span class="">#{(order.commisionPolicy.chdCommision)!0;m2M2}%</span></li>
			     	<li class="commision_reward"><label>奖励扣</label><span>#{(order.commisionPolicy.chdReward)!0;m2M2}%</span></li>
			     	<li><label>开票手续费</label><span> #{(order.commisionPolicy.chdTicketingPrice)!0;m2M2}</span></li>
			    </ul>
		     	<#elseif passengerType! ="INF">
		     	 <ul class="detail_item5">	     		
			        <li><strong>婴儿</strong></li>
			       	<li class="commision_reward"><label>代理费</label><span>#{(order.commisionPolicy.infCommision)!0;m2M2}%</span></li>
			   		<li class="commision_reward"><label>奖励扣</label><span>#{(order.commisionPolicy.infReward)!0;m2M2}%</span></li>
			    	<li><label>开票手续费</label><span> #{(order.commisionPolicy.infTicketingPrice)!0;m2M2}</span></li>
			    </ul>
	     		</#if>
	     	</#if>
	     </#list>
		</div>
		<div class="detail_box cl">
			<strong>航班信息</strong>
			<table class="table table-border  table-bordered radius table-hover">
				<thead class="text-c">
					<tr>
						<th width="10%">出发地点</th>
						<th width="10%">到达地点</th>
						<th width="15%">出发时间</th>
						<th width="15%">到达时间</th>
						<th width="15%">航空公司</th>
						<th width="10%">航班号</th>
						<th width="5%">舱位</th>
					</tr>	
				</thead>
				<#list order.flights! as flight>
					<#list flight.segments! as segment>
						<tr class="text-c">
							<td>${(segment.departureCityName!'')+"("+(segment.departureCity!'')+")"}</td>
							<td>${(segment.arrivalCityName!'')+"("+(segment.arrivalCity!'')+")"}</td>
							<td>${(segment.departureDate!'')+" "+(segment.departureTime!'')}</td>
							<td>${(segment.arrivalDate!'')+" "+(segment.arrivalTime!'')}</td>
							<td>${(segment.airlineName!'')+"("+(segment.airline!'')+")"}</td>
							<td>${(segment.airline!'')+(segment.flightNo!'')}</td>
							<td>${segment.bookingCode!''}</td>	
						</tr>
					</#list>
				</#list>
			</table>
		</div>
		<div class="detail_box cl">
			<strong>乘客信息</strong>
			<table class="table table-border  table-bordered radius table-hover">
				<thead class="text-c">		
					<tr>
						<th width="4%">序号</th>
						<th width="5%">业务状态</th>
						<th width="10%">乘机人</th>
						<th width="5%">性别</th>
						<th width="8%">国籍</th>
						<th width="5%">乘客类型</th>
						<th width="5%">证件类型</th>
						<th width="10%">证件号码</th>
						<th width="10%">证件有限期</th>
						<th width="13%">票号</th>
					</tr>
				</thead>
				<#list order.passengers as passenger>
					<tr class="text-c">
						<td>${passenger_index+1}</td>
						<td><span>${order.orderStatusName!""}</span></td>
						<td>${passenger.passengerNameEn!''}</td>
						<td>${passenger.genderName!''}</td>				
						<td>${passenger.nationality!''}</td>
						<td><span>${passenger.passengerTypeName!''}<span></td>
						<td><span>${passenger.cardTypeName!""}</span></td>
						<td>${passenger.cardNum!''}</td>
						<td>${passenger.cardDateStr!''}</td>
						<td>
							<#if (order.fare.ticketNum)??>
			        			${order.fare.ticketNum!}
			        		<#else>
			        			未出票
			        		</#if>						
						</td>
					</tr>
				</#list>
			</table>	
		</div>
		<#--出票成功以后的操作才有的费用明细-->
		<#if order.orderStatus! ='ORDER_STATUS_TICKETED' || order.orderStatus! ='ORDER_STATUS_CHANGING' || order.orderStatus! ='ORDER_STATUS_CHANGED' || order.orderStatus! ='ORDER_STATUS_REFUNDING' || order.orderStatus! ='ORDER_STATUS_REFUNDED' || order.orderStatus! ='ORDER_STATUS_INVALIDING'>
		<div class="detail_box cl ">
			<strong>费用明细</strong>
			<table class="table table-border table-bordered radius table-hover">
				<thead class="text-c">
					<tr>
						<th width="10%">类型</th>
						<th width="10%">人数</th>
						<th width="10%">价格</th>
						<th width="10%">服务费</th>
						<th width="40%">姓名</th>
					</tr>
				</thead>			
				<#--<#list passengerMap.passengerTypes?keys as passengerType>-->
					<#if passengerMap.passengerTypes.ADT! ="ADT">
						<tr class="text-c">
							<td><span>成人<span></td>
							<td><span>${passengerMap.adultCount!0}</span></td>
							<td><#if passengerMap.adultFare??>${passengerMap.adultFare.totalAmount!0 * passengerMap.adultCount!0}</#if></td>
							<td>${passengerMap.adultFare.servicePrice!0}</td>
							<td><#list passengerMap.adultNames! as adultName><span>${adultName!''}</span></#list></td>
						</tr>
					</#if>
					<#if passengerMap.passengerTypes.CHD! ="CHD">
						<tr class="text-c">
							<td><span>儿童<span></td>
							<td>${passengerMap.childCount!''}</span></td>
							<td><#if passengerMap.childFare??>${passengerMap.childFare.totalAmount!0 * passengerMap.childCount!0}</#if></td>
							<td>${passengerMap.childFare.servicePrice!0}</td>
							<td><#list passengerMap.childNames! as childName><span>${childName!''}</span></#list></td>
						</tr>
					</#if>
					<#if passengerMap.passengerTypes.INF! ="INF">							
						<tr class="text-c">
							<td><span>婴儿<span></td>
							<td>${passengerMap.infantCount!''}</td>
							<td><#if passengerMap.infantFare??>${passengerMap.infantFare.totalAmount!0 * passengerMap.infantCount!0}</#if></td>
							<td>${passengerMap.infantFare.servicePrice!0}</td>
							<td><#list passengerMap.infantNames! as infantName><span>${infantName!''}</span></#list></td>
						</tr>
					<#else>
						<tr>
							<td></td>
							<td><span>${passengerMap.adultCount!0}</span></td>
							<td><#if passengerMap.adultFare??>${passengerMap.adultFare.totalAmount!0 * passengerMap.adultCount!0}</#if></td>
							<td>${passengerMap.adultFare.servicePrice!0}</td>
							<td><#list passengerMap.adultNames! as adultName><span>${adultName!''}</span></#list></td>
						</tr>
					</#if>			
			</table>
			<p class="f-16 pt-20">出票支付金额：<span class="c-red">¥${order.totalAmount!""}</span></p>
		</div>
		</#if>
		<#--待审核订单状态的判断-->
		<#if order.orderStatus! ='ORDER_STATUS_CHECKING'>
			<div class="detail_box cl">
				<strong>费用明细</strong>
				<table class="table table-border table-bordered radius">
					<thead class="text-c">
					<tr>
						<th width="4%">类型</th>
						<th width="4%">人数</th>
						<th width="8%">运价基础</th>
						<th width="8%">税收</th>
						<th width="8%">Q值</th>
						<th width="8%">代理</th>
						<th width="8%">奖励</th>
						<th width="8%">开票费</th>
						<th width="8%">服务费</th>
						<th width="8%">结算价</th>
					</tr>
					</thead>
					<#list passengerMap.passengerTypes?keys as passengerType>
						<#if passengerType! ="ADT">
							<tr class="text-c">
								<td><span>成人<span></td>
								<td><span>${passengerMap.adultCount!0}</span></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.adultFare.ticketPrice)!0}" disabled /></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.adultFare.tax)!0}" disabled /></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="0" disabled></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.adultFare.commisionPrice)!0}"></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.adultFare.reward)!0}"></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.adultFare.ticketingPrice)!0}"></td>
								<td>${(passengerMap.adultFare.servicePrice)!0}</td>
								<td><#if passengerMap.adultFare??>${passengerMap.adultFare.totalAmount*passengerMap.adultCount!0}</#if></td>
							</tr>
						<#elseif passengerType! ="CHD">
							<tr>
								<td><span>儿童<span></td>
								<td><span>${passengerMap.childCount!}</span></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.childFare.ticketPrice)!0}" disabled></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.childFare.tax)!''}" disabled></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="0" disabled></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.childFare.commisionPrice)!0}"></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.childFare.reward)!0}"></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.childFare.ticketingPrice)!0}"></td>
								<td>${(passengerMap.childFare.servicePrice)!0}</td>
								<td><#if passengerMap.childFare??>${passengerMap.childFare.totalAmount*passengerMap.childCount!0}</#if></td>
							</tr>
						<#elseif passengerType! ="INF">							
							<tr>
								<td><span>婴儿<span></td>
								<td><span>${passengerMap.infantCount!}</span></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.infantFare.ticketPrice)!0}" disabled></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.infantFare.tax)!0}" disabled></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="0" disabled></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.infantFare.commisionPrice)!0}"></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.infantFare.reward)!0}"></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.infantFare.ticketingPrice)!0}"></td>
								<td>${(passengerMap.infantFare.servicePrice)!0}</td>
								<td><#if passengerMap.infantFare??>${passengerMap.infantFare.totalAmount*passengerMap.infantCount!0}</#if></td>
							</tr>
						<#elseif passengerType! ="OTHER">
							<tr class="text-c">
								<td></td>
								<td><span>${passengerMap.otherCount!0}</span></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.otherFare.ticketPrice)!0}" disabled /></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.otherFare.tax)!0}" disabled /></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="0" disabled></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.otherFare.commisionPrice)!0}"></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.otherFare.reward)!0}"></td>
								<td><input class="input-text-smini radius size-MINI" type="text" name="" value="${(passengerMap.otherFare.ticketingPrice)!0}"></td>
								<td>${(passengerMap.otherFare.servicePrice)!0}</td>
								<td><#if passengerMap.otherFare??>${passengerMap.otherFare.totalAmount*passengerMap.otherCount!0}</#if></td>
							</tr>
						</#if>
					</#list>
				</table>
				<p class="f-16 mt-20 f-l">出票支付金额：<span class="c-red">¥${order.totalAmount!""}</span></p>
				<input type="button" class="btn btn-primary radius f-r mt-20" onClick="checking(1,'checked?orderId=${order.orderId!''}&policyIds=${(order.commisionPolicy.policyIds)!''}')"  style="width:100px" value="通过审核">
				<input type="button" class="btn btn-default radius mr-20 f-r mt-20" onClick="checking(-1,'unchecked?orderId=${order.orderId}')"  value="拒回" style="width:100px">			
			</div>
			<div class="detail_box cl">
				<strong>政策信息</strong>
				<table class="table table-border table-bordered radius">
						<tr class="text-c">
							<th width="5%">选择</th>
							<th width="10%">政策编号</th>
							<th width="15%">代理费</th>
							<th width="15%">奖励</th>
							<th width="15%">开票费</th>
							<th width="10%">出票方式</th>
							<th width="10%">详细信息</th>
						</tr>					
					<#if order.policys??>
						<#list order.policys as policy>						
							<tr class="text-c tr_commisionPolicy">
								<td><input type="checkbox" class="ckeck-box policyId" name="policyId" id="policyId" value="${policy.policyId!''}" checked disabled></td>
								<td><span>${policy.policyId!''}</span></td>
								<td><span>${policy.commision!''}</span></td>
								<td><span>${policy.reward!0}</span></td>
								<td><span>${policy.ticketingPrice!0}</span></td>
								<td><span><#if policy.autoTicketFlag!'' ='Y'>自动出票<#else>手动出票</#if><span></td>
								<td><span><a id="a_commisionPolicy" class="c-primary a_commisionPolicy" href="javascript:;">展开</a></span></td>
							</tr>
							<tr class="text-l tr_commisionPolicy_detail" id="tr_commisionPolicy" style="display:none">
								<td colspan="7">${policy.memoExt!}</td>
							</tr>
						</#list>
					<#else>
					<tr>
						<td colspan="7">暂无政策</td>
					</tr>
					</#if>
				</table>
			</div>
		</#if>
		<#--待出票订单下的详情-->
		<#if order.orderStatus! ='ORDER_STATUS_TICKETING'>
		<div class="detail_box cl">
			<strong>出票操作</strong>
			<p>请按该样例完整输入，可直接在样例中进行修改</p>
			<form id="form" method="post" action="" >
				<input type="hidden" name="orderId" value="${order.orderId!''}">
				<textarea class="detail_textarea" name="detailTextarea" id="detail_textarea"></textarea><br>
				<input type="button" onClick="ticketing(${order.orderId!''})" class="btn radius btn-primary" style="width:100px" value="提交">
				<input type="reset" class="btn radius btn-default" style="width:100px" value="重置">
			</form>
		</div>
		</#if>
		<div class="detail_box cl">
			<strong>日志记录</strong>
			<table>
				<#list order.logs as log>
					<tr>
						<td width="10%">${log.creationDateStr!}</td>
						<td width="70%">${log.operation!}</td>
					</tr>
				</#list>
			</table>
		</div>
	</div>
</body>
</html>